load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")

oncall("scm_client_infra")

cpp_library(
    name = "rpc",
    srcs = [
        "Rpc.cpp",
        "StreamClient.cpp",
    ],
    headers = [
        "Rpc.h",
        "StreamClient.h",
    ],
    deps = [
        "//folly:exception",
        "//folly:string",
    ],
    exported_deps = [
        "//eden/fs/nfs/xdr:xdr",
        "//folly:network_address",
        "//folly/io:iobuf",
        "//folly/logging:logging",
        "//folly/net:network_socket",
    ],
)

cpp_library(
    name = "server",
    srcs = ["RpcServer.cpp"],
    headers = ["RpcServer.h"],
    deps = [
        "//eden/common/telemetry:structured_logger",
        "//eden/common/utils:throw",
        "//eden/fs/telemetry:log_info",
        "//folly:string",
        "//folly/futures:core",
        "//folly/io:iobuf",
    ],
    exported_deps = [
        ":rpc",
        "//eden/common/utils:immediate_future",
        "//eden/fs/inodes:fs_channel",
        "//eden/fs/nfs/portmap:portmap",
        "//eden/fs/utils:event_base_state",
        "//folly:network_address",
        "//folly/io/async:async_socket",
        "//folly/io/async:server_socket",
        "//folly/net:network_socket",
    ],
)
